1. /* sdclog10.cpp by K.Tsuru */
  2. // function ID 3522 DARDIX
  3. // constant log(10)
  4. /*************************
  5. In header "snmath.h" the function prototype is declared below
  6. --------
  7. SDouble Log10(const SDouble* ln10 = NULL, SDouble (*pfCalcFunc)() = SNLog10);
  8. --------
  9. Remade at version 2.30.
  10. **************************/
  11. #ifndef SN_H
  12. #include "sn.h"
  13. #endif
  14. static SDouble* ln10 = NULL; //keep in the static memory
  15. static uint ln10Size = 0;
  16. void Log10Free(){
  17. if(ln10Size == 0) return;
  18. delete ln10; ln10 = NULL; ln10Size = 0;
  19. }
  20. uint Log10Size() { return ln10Size; }
  21. SDouble Log10(const SDouble* userln10, SDouble (*pfCalcFunc)()){
  22. if(ln10 == NULL) ln10 = new SDouble;
  23. uint curMaxSize = ln10->MaxSize(); // current max size
  24. if( ln10Size < curMaxSize ){ // renew
  25. #if UsesSNConstantFile
  26. if(userln10 == NULL){ //called by default argument
  27. int enough;
  28. /**********************************************************************************
  29. UpdateConstantFile() recursively calls this function Log10() via SetConstByFile()
  30. of which userln10 != NULL, then does not come here and processing below has been
  31. done.
  32. **********************************************************************************/
  33. enough = UpdateConstantFile(Log10_FILE, Log10, pfCalcFunc, curMaxSize);
  34. if(enough != NO_SNC_FILE) return *ln10;
  35. }
  36. #endif
  37. ln10->ShowMessage("Evaluating Log10() now.....");
  38. EntryConst(userln10, ln10, pfCalcFunc, &ln10Size);
  39. ln10->ShowMessage(" Finished.\n"); // ver. 2.17
  40. ln10Size = curMaxSize;
  41. }
  42. return *ln10;
  43. }

sdclog10.cpp : last modifiled at 2017/06/23 10:57:39(1,564 bytes)
created at 2017/10/07 10:21:15
The creation time of this html file is 2017/10/07 10:30:03 (Sat Oct 07 10:30:03 2017).